package com.powervision.mvvmdemo.ui.viewmodel

import com.powervision.base.base.BaseViewModel
import com.powervision.http.observer.StateLiveData
import com.powervision.mvvmdemo.ui.model.HotKeyModel
import com.powervision.mvvmdemo.ui.repository.HotKeyRepository

/**
 * @auth: njb
 * @date: 2021/12/21 11:24
 * @desc: 描述
 */
class HotKeyViewModel : BaseViewModel() {
    val mHotLiveData = StateLiveData<List<HotKeyModel>>()
    private val mHotKeyRepository by lazy { HotKeyRepository() }

    fun hotKey() {
        launchWithLoading(requestBlock = {
            mHotKeyRepository.hotkey()
        }, resultCallback = {
            mHotLiveData.value = it
        })
    }
}